﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using nPress.Core.Entities;

namespace nPress.Core.Mapping
{
    public class TermRelationshipMap : MapBase<TermRelationship>
    {
        #region SQL
        /*
         CREATE TABLE term_relationships (
             object_id bigint(20) unsigned NOT NULL default 0,
             term_taxonomy_id bigint(20) unsigned NOT NULL default 0,
             term_order int(11) NOT NULL default 0,
             PRIMARY KEY  (object_id,term_taxonomy_id),
             KEY term_taxonomy_id (term_taxonomy_id)
            )
         */
        #endregion

        public TermRelationshipMap() : base("term_relationships")
        {
            Id(x => x.Id, "object_id");
            References(x => x.TermTaxonomy, "term_taxonomy_id").Not.Nullable();
            Map(x => x.TermOrder, "term_order").Not.Nullable();
        }
    }
}
